// import {ReactNode} from "react"
// import Login from "@/pages/login"
// import Home from "@/pages/home"

import React,{lazy} from "react"
import { createFromIconfontCN } from '@ant-design/icons';
const MyIcon = createFromIconfontCN({
    scriptUrl: '//at.alicdn.com/t/c/font_2402710_ffno0awfcu.js', // 在 iconfont.cn 上生成
});
let Login = lazy(() => import('@/pages/login/index'))
let Pages404 = lazy(() => import('@/pages/pages404/index'))
let PayManagerment = lazy(() => import('@/pages/payManagerment/index'))
let PayType = lazy(() => import('@/pages/payManagerment/payType/index'))
let PictureManagerment = lazy(() => import('@/pages/pictureManagerment/index'))
let CarsouelManagerment = lazy(() => import('@/pages/pictureManagerment/carsouelManagerment/index'))
let ProductManagerment = lazy(() => import('@/pages/productManagerment'))
let ProductCategory = lazy(() => import('@/pages/productManagerment/productCategory'))
let ProductList = lazy(() => import('@/pages/productManagerment/productList'))
let TransactionManagerment = lazy(() => import('@/pages/transactionManagerment/index'))
let Amount = lazy(() => import('@/pages/transactionManagerment/amount/index'))
let Order = lazy(() => import('@/pages/transactionManagerment/order/index'))
let Refund = lazy(() => import('@/pages/transactionManagerment/refund/index'))
let LayoutBase = lazy(() => import('@/layOut/index'))

let ContentBase = lazy(() => import("@/layOut/content"))

let routes:RouteObj[] = [
    {
       path: "/login",
       element: <Login />
    },
    {
      path: "*",
      element: <Pages404 />
    },
    {
      path: "/",
      element: <ContentBase />,
      // element: <LayoutBase/>,
      children: [
         {
            path: '/productManagerment',
            element: <ProductManagerment />,
            label: '商品管理',
            key: 'productManagerment',
            icon: <MyIcon type="icon-shangpinguanli" />,
            children: [
               {
                  path: 'productCategory',
                  element: <ProductCategory/>,
                  label: '产品类目',
                  key: 'productCategory',
                  icon: <MyIcon type="icon-tubiaozhizuomoban" />,
               },
               {
                  path: 'productList',
                  element: <ProductList/>,
                  label: '产品列表',
                  key: 'productList',
                  icon: <MyIcon type="icon-liebiao" />
               },
            ]
         },
         {
            path: '/pictureManagerment',
            element: <PictureManagerment />,
            label: '图片管理',
            key: 'pictureManagerment',
            icon: <MyIcon type="icon-tupian" />,
            children: [
               {
                  path: 'carsouelManagerment',
                  element: <CarsouelManagerment/>,
                  label: '轮播图管理',
                  key: 'carsouelManagerment',
                  icon: <MyIcon type="icon-drxx70" />
               }
            ]
         },
         {
            path: '/payManagerment',
            element: <PayManagerment />,
            label: '支付管理',
            key: 'payManagerment',
            icon: <MyIcon type="icon-ziyuan" />,
            children: [
               {
                  path: 'payType',
                  element: <PayType/>,
                  label: '支付类型',
                  key: 'payType',
                  icon:<MyIcon type = "icon-zhifu" />
               }
            ]
         },
         {
            path: '/transactionManagerment',
            element: <TransactionManagerment />,
            label: '交易管理',
            key: 'transactionManagerment',
            icon: <MyIcon type="icon-biaoqiankuozhan_jiaoyi-195" />,
            children: [
               {
                  path: 'amount',
                  element: <Amount/>,
                  label: '交易金额',
                  key: 'amount',
                  icon: <MyIcon type="icon-icon_A" />
               },
               {
                  path: 'order',
                  element: <Order/>,
                  label: '订单管理',
                  key: 'order',
                  icon: <MyIcon type="icon-cangpeitubiao_dingdan" />
               },
               {
                  path: 'refund',
                  element: <Refund/>,
                  label: '退款管理',
                  key: 'refund',
                  icon: <MyIcon type="icon-tuikuan" />
               },
            ]
         },

      ]
    },
   //  {
   //      path: "/home",
   //      element: <Home />
   //   }
]

export default routes